package com.example.joke.thread

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.joke.R
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.util.concurrent.Executors
import kotlin.concurrent.thread
import kotlin.coroutines.EmptyCoroutineContext

class ThreadActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_thread)

        threadTest()
    }

    private fun threadTest() {
        thread {

        }

        val executor = Executors.newCachedThreadPool()
        executor.execute {

        }

//        val scope = CoroutineScope(EmptyCoroutineContext)
        val scope = CoroutineScope(Dispatchers.Default)

        scope.launch {

        }

        scope.launch(Dispatchers.Main) {

        }
    }
}